﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.Common;
using DataAccess;

public partial class Manager_Profile : System.Web.UI.Page
{
    DataTable table;
    string ManagerID = "";   
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["ManagerID"] != "")
        {
            DbCommand cmd = GenericData.CreateCommand();
            ManagerID = Session["ManagerID"].ToString();
            cmd.CommandText = "SELECT * FROM Manager WHERE ID = " + ManagerID;
            table = GenericData.ExecuteReader(cmd);

            if (table.Rows.Count > 0)
            {
                txtUsername.Text = table.Rows[0]["Username"].ToString();
                txtEmail.Text = table.Rows[0]["Email"].ToString();
                txtFullname.Text = table.Rows[0]["Fullname"].ToString();
                txtMobile.Text = table.Rows[0]["Mobile"].ToString();
                txtAddress.Text = table.Rows[0]["Address"].ToString();
            }

            if (Session["Message"] != null)
            {
                lblmes.Text = Session["Message"].ToString();
                Session.Remove("Message");
            }
            else
                lblmes.Text = "";

        }
    }
}